#ifndef CSV_H
#define CSV_H

#include <QObject>
#include <QStringList>
#include <QIODevice>
#include <QTextCodec>
#include <QRegExp>
#include "Macro.h"

class Csv
{
	/*Q_OBJECT*/

public:
	Csv(QIODevice * device);
	Csv(QString &string);
	~Csv();

	QString readLine();
	QStringList parseLine();
	QStringList parseLine(QString line);

	void setCodec(const char* codecName);

private:
	QIODevice *m_device;
	QTextCodec *m_codec;
	QString m_string;
	int m_pos;
	QRegExp m_rx;

};

#endif
